package com.huawei.fakedouyin.config

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch

/**
 * 日期：2022/9/7
 * 作者：wyt
 * 备注：君子以厚德载物
 */

fun CoroutineScope.launchMain(block: suspend CoroutineScope.() -> Unit): Job {
    return launch(Dispatchers.Main) {
        block()
    }
}

fun CoroutineScope.launchIO(block: suspend CoroutineScope. () -> Unit): Job {
    return launch(Dispatchers.IO) {
        block()
    }
}